<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- 
        v-for指令 基于数据循环，多次渲染整个【元素】 → 数组、对象、数字...
    -->
    <div id="app">
        <h3>小黑水果店</h3>
        <ul>
            <li v-for="(item, index) in fruits">
                {{ item }} - {{ index }}
            </li>
        </ul>

        <ul>
            <li v-for="item in fruits">
                {{ item }}
            </li>
        </ul>
    </div>



    <script src="./js/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                fruits: ['苹果', '香蕉', '橘子', '榴莲']
            }
        })
    </script>

</body>

</html>